/**
 * 
 * @authors Your Name (you@example.org)
 * @date    2016-08-27 12:47:14
 * @version $Id$
 * 合并HTML的webpack配置文件
 * 
 */

var webpack = require('webpack');
var path = require('path');
var ExtractTextWebpackPlugin = require('extract-text-webpack-plugin');

module.exports = {
	entry : {
		chat : './p_src/html/entry_js/chat.js',
		service : './p_src/html/entry_js/service.js',
		thread : './p_src/html/entry_js/thread.js',
		//quickreply : './p_src/html/entry_js/quickreply.js',
		remark : './p_src/html/entry_js/remark.js',
		login : './p_src/html/entry_js/login.js',
		bind : './p_src/html/entry_js/bind.js',
		label : './p_src/html/entry_js/label.js',
	},
	output : {
		path : './p_bin/',
		publicPath : '../',
		filename : 'html_js/[name].js'
	},
	module : {
		loaders : [
			{
				test : /\.html$/,
				loader : ExtractTextWebpackPlugin.extract('html-loader')
			},
    	{ 
    		test: /\.(png|jpg|gif)$/, 
    		loader: 'file-loader?name=imgs/[hash:8].[name].[ext]' 
    	}
		]
	},
	plugins : [
		new webpack.optimize.UglifyJsPlugin({
		    compress: {
		        warnings: false,
		    },
		    output: {
		        comments: false,
		    },
		}),
		new ExtractTextWebpackPlugin('html/[name].php')
	]
};